package com.fenghongzhang.day13;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ScrollView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {
    private ScrollView scrollView;
    private LinearLayout ll;
    private EditText edit;
    private MySearchView mySearchView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        scrollView = (ScrollView) findViewById(R.id.scrollView);
        ll = (LinearLayout) findViewById(R.id.ll);
        edit = (EditText) findViewById(R.id.edit);
        mySearchView = (MySearchView) findViewById(R.id.my_search_view);


        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this){
            @Override
            public boolean canScrollVertically() {
                return false;
            }
        };
        mySearchView.setLayoutManager(linearLayoutManager);

        List<History> list = new ArrayList<>();
        list.add(new History("啊哈哈哈"));
        list.add(new History("啊哈哈哈"));
        list.add(new History("啊哈哈哈1"));
        list.add(new History("啊哈哈哈2"));
        list.add(new History("啊哈哈哈3"));
        list.add(new History("啊哈哈哈4"));
        list.add(new History("啊哈哈哈4"));
        list.add(new History("啊哈哈哈55"));
        list.add(new History("啊哈哈哈55"));
        list.add(new History("啊哈哈哈"));
        MyAdapter myAdapter = new MyAdapter(R.layout.rv_layout, list);

        mySearchView.setAdapter(myAdapter);


    }

    public void dian(View view) {
        mySearchView.setFull(true);
    }
}
